package com.woniuxy.sddfp.system.controller;

import com.woniuxy.sddfp.common.model.dto.user.UserRegisterDto;
import com.woniuxy.sddfp.common.result.Result;
import com.woniuxy.sddfp.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author yellow doctor
 * @since 2025-05-09
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * Valid为参数校验注解
     * 用户注册
     */
    @PostMapping("/regist")
    public Result regist(@RequestBody @Valid UserRegisterDto userRegisterDto){

        userService.regist(userRegisterDto);

        return Result.ok();
    }

}
